﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo.PeInspector.Native
{
	/// <summary>
	/// Specifies the condition of the processor status flags.
	/// </summary>
	public enum StatusCondition
	{
		/// <summary>
		/// Unsigned: x &gt; y (<c>CF</c> == 0 && <c>ZF</c> == 0)
		/// </summary>
		Above,
		/// <summary>
		/// Same as <see cref="Above"/> (<c>CF</c> == 0 && <c>ZF</c> == 0)
		/// </summary>
		NotBelowOrEqual = Above,

		/// <summary>
		/// Unsigned: x &gt;= y (<c>CF</c> == 0)
		/// </summary>
		AboveOrEqual,
		/// <summary>
		/// Same as <see cref="AboveOrEqual"/> (<c>CF</c> == 0)
		/// </summary>
		NotCarry = AboveOrEqual,
		/// <summary>
		/// Same as <see cref="AboveOrEqual"/> (<c>CF</c> == 0)
		/// </summary>
		NotBelow = AboveOrEqual,

		/// <summary>
		/// Unsigned: x &lt; y (<c>CF</c> == 1)
		/// </summary>
		Below,
		/// <summary>
		/// Same as <see cref="Below"/> (<c>CF</c> == 1)
		/// </summary>
		Carry = Below,
		/// <summary>
		/// Same as <see cref="Below"/> (<c>CF</c> == 1)
		/// </summary>
		NotAboveOrEqual = Carry,

		/// <summary>
		/// Unsigned: x &lt;= y (<c>CF</c> ==1 || <c>ZF</c> == 1)
		/// </summary>
		BelowOrEqual,
		/// <summary>
		/// Same as <see cref="BelowOrEqual"/> (<c>CF</c> ==1 || <c>ZF</c> == 1)
		/// </summary>
		NotAbove = BelowOrEqual,

		/// <summary>
		/// x == 0 (<c>ZF</c> == 1)
		/// </summary>
		Equal,
		/// <summary>
		/// Same as <see cref="Equal"/> (<c>ZF</c> == 1)
		/// </summary>
		Zero = Equal,

		/// <summary>
		/// Signed: x &gt; y (<c>ZF</c> == 0 && <c>SF</c> == <c>OF</c>)
		/// </summary>
		Greater,
		/// <summary>
		/// Same as <see cref="Greater"/> (<c>ZF</c> == 0 && <c>SF</c> == <c>OF</c>)
		/// </summary>
		NotLessOrEqual = Greater,

		/// <summary>
		/// Signed: x &gt;= y (<c>SF</c> == <c>OF</c>)
		/// </summary>
		GreaterOrEqual,
		/// <summary>
		/// Same as <see cref="GreaterOrEqual"/> (<c>SF</c> == <c>OF</c>)
		/// </summary>
		NotLess = GreaterOrEqual,

		/// <summary>
		/// Signed: x &lt; y (<c>SF</c> != <c>OF</c>)
		/// </summary>
		Less,
		/// <summary>
		/// Same as <see cref="Less"/> (<c>SF</c> != <c>OF</c>)
		/// </summary>
		NotGreaterOrEqual = Less,

		/// <summary>
		/// Signed: x &lt;= y (<c>ZF</c> == 1 || <c>SF</c> != <c>OF</c>)
		/// </summary>
		LessOrEqual,
		/// <summary>
		/// Same as <see cref="LessOrEqual"/> (<c>ZF</c> == 1 || <c>SF</c> != <c>OF</c>)
		/// </summary>
		NotGreater = LessOrEqual,

		/// <summary>
		/// x != y (<c>ZF</c> == 0)
		/// </summary>
		NotEqual,	// ZF=0
		/// <summary>
		/// Same as <see cref="NotEqual"/> (<c>ZF</c> == 0)
		/// </summary>
		NotZero = NotEqual,

		/// <summary>
		/// <c>OF</c> == 0
		/// </summary>
		NotOverflow,

		/// <summary>
		/// Odd parity (<c>PF</c> == 0)
		/// </summary>
		ParityOdd,
		/// <summary>
		/// Same as <see cref="ParityOdd"/> (<c>PF</c> == 0)
		/// </summary>
		NotParity = ParityOdd,

		/// <summary>
		/// <c>SF</c> == 0
		/// </summary>
		NotSign,

		/// <summary>
		/// Overflow (<c>OF</c> == 1)
		/// </summary>
		Overflow,

		/// <summary>
		/// Even parity (<c>PF</c> == 1)
		/// </summary>
		ParityEven,
		/// <summary>
		/// Same as <see cref="ParityEven"/> (<c>PF</c> == 1)
		/// </summary>
		Parity = ParityEven,

		/// <summary>
		/// <c>SF</c> == 1
		/// </summary>
		Sign,
	}
}
